a=input()
isError='yes'
mass=[ ]
for i in a:
    if '[' == i ==  '(' or i == '{':
        mass.append(i)
    elif mass:
        if ']' == i and  mass[-1] =='[' :
            mass.pop()
        elif ')' == i and mass[-1] == '(':
            mass.pop()
        elif '}' == i and mass[-1] == '{':
            mass.pop()
        elif '>' == i and mass[-1] == '<':
             mass.pop()
        else:
            isError='no'
print (isError)
